ARROW-8459: [Dev][Archery] Use a more recent cmake-format#10571
Conversation
| "AVX2" | ||
| "AVX512" | ||
| "MAX") | ||
| define_option_string( |
There was a problem hiding this comment.
I think we can alter this tabulation behavior using https://cmake-format.readthedocs.io/en/latest/configopts.html#min-prefix-chars
There was a problem hiding this comment.
Could you try 32 or something?
I don't expect formatter so much but I want to reduce diff to look history easily later.
There was a problem hiding this comment.
Yes, I'm going to try formatting with min-prefix-chars=32
| def __init__(self, cmake_format_bin): | ||
| self.bin = cmake_format_bin | ||
|
|
||
| # TODO(kszucs): check cmake_format version |
There was a problem hiding this comment.
I don't know if you can do it in this PR?
There was a problem hiding this comment.
Wait, it seems done already below. Perhaps just remove this TODO?
There was a problem hiding this comment.
Yep, thanks for spotting that!
| 'go/**/CMakeLists.txt', | ||
| 'java/**/CMakeLists.txt', | ||
| 'matlab/**/CMakeLists.txt', | ||
| ], |
There was a problem hiding this comment.
We have cmake files in python as well, no?
There was a problem hiding this comment.
Those haven't been checked earlier either https://github.com/apache/arrow/blob/master/run-cmake-format.py#L29
I think we could simply use a global pattern with an exclusion list rather.
There was a problem hiding this comment.
We have only python/CMakeLists.txt in python/.
python/cmake_modules/ is a symbolic link to cpp/cmake_modules/.
There was a problem hiding this comment.
I added python/CMakeLists.txt.
| 'cpp/cmake_modules/FindPythonLibsNew.cmake', | ||
| 'cpp/cmake_modules/UseCython.cmake', | ||
| 'cpp/src/arrow/util/config.h.cmake', | ||
| ] |
There was a problem hiding this comment.
Do you know the reasons for these exclusions?
There was a problem hiding this comment.
Ported from the previous script, I assume these files are vendored or generated.
There was a problem hiding this comment.
cpp/cmake_modules/*.cmake in the list are imported CMake files: #9045 (comment)
We can't use cmake-format for cpp/src/arrow/util/config.h.cmake because it's not valid CMake file. It has @...@ to replace variables by CMake.
| LLVMAlt | ||
| REQUIRED_VARS # The first variable is used for display. | ||
| LLVM_PACKAGE_VERSION CLANG_EXECUTABLE LLVM_FOUND LLVM_LINK_EXECUTABLE) |
There was a problem hiding this comment.
| LLVMAlt | |
| REQUIRED_VARS # The first variable is used for display. | |
| LLVM_PACKAGE_VERSION CLANG_EXECUTABLE LLVM_FOUND LLVM_LINK_EXECUTABLE) | |
| LLVMAlt | |
| # The first variable is used for display. | |
| REQUIRED_VARS LLVM_PACKAGE_VERSION CLANG_EXECUTABLE LLVM_FOUND LLVM_LINK_EXECUTABLE) |
| Arrow | ||
| REQUIRED_VARS # The first required variable is shown | ||
| # in the found message. So this list is | ||
| # not sorted alphabetically. | ||
| ARROW_INCLUDE_DIR ARROW_LIB_DIR ARROW_FULL_SO_VERSION ARROW_SO_VERSION |
There was a problem hiding this comment.
| Arrow | |
| REQUIRED_VARS # The first required variable is shown | |
| # in the found message. So this list is | |
| # not sorted alphabetically. | |
| ARROW_INCLUDE_DIR ARROW_LIB_DIR ARROW_FULL_SO_VERSION ARROW_SO_VERSION | |
| Arrow | |
| # The first required variable is shown in the found message. So this list is | |
| # not sorted alphabetically. | |
| REQUIRED_VARS ARROW_INCLUDE_DIR ARROW_LIB_DIR ARROW_FULL_SO_VERSION ARROW_SO_VERSION |
| 'go/**/CMakeLists.txt', | ||
| 'java/**/CMakeLists.txt', | ||
| 'matlab/**/CMakeLists.txt', | ||
| ], |
There was a problem hiding this comment.
We have only python/CMakeLists.txt in python/.
python/cmake_modules/ is a symbolic link to cpp/cmake_modules/.
| 'cpp/cmake_modules/FindPythonLibsNew.cmake', | ||
| 'cpp/cmake_modules/UseCython.cmake', | ||
| 'cpp/src/arrow/util/config.h.cmake', | ||
| ] |
There was a problem hiding this comment.
cpp/cmake_modules/*.cmake in the list are imported CMake files: #9045 (comment)
We can't use cmake-format for cpp/src/arrow/util/config.h.cmake because it's not valid CMake file. It has @...@ to replace variables by CMake.
| "AVX2" | ||
| "AVX512" | ||
| "MAX") | ||
| define_option_string( |
There was a problem hiding this comment.
Could you try 32 or something?
I don't expect formatter so much but I want to reduce diff to look history easily later.
|
@kou updated the formatting with |
kou
left a comment
There was a problem hiding this comment.
+1
Thanks. It looks good with min-prefix-chars=32.
| 'go/**/CMakeLists.txt', | ||
| 'java/**/CMakeLists.txt', | ||
| 'matlab/**/CMakeLists.txt', | ||
| ], |
This is a follow-up of apache#10571 / ARROW-8459 .
This is a follow-up of #10571 / ARROW-8459 . Closes #11112 from kou/github-actions-autotune Authored-by: Sutou Kouhei <kou@clear-code.com> Signed-off-by: Sutou Kouhei <kou@clear-code.com>
This is a follow-up of apache#10571 / ARROW-8459 . Closes apache#11112 from kou/github-actions-autotune Authored-by: Sutou Kouhei <kou@clear-code.com> Signed-off-by: Sutou Kouhei <kou@clear-code.com>
- [x] bump cmake-format's version to the latest one - [x] port `run-cmake-format.py` script to archery - [x] support `archery lint --cmake-format` format checks without reformatting the files in-place - [x] support `archery lint --cmake-format --fix` for actually reformat the files - [x] reformat the cmake files I assume we may need tune the options a little bit, so feel free to experiment with the values defined in `cmake-format.py` then re-run `archery-lint --cmake-format --fix`. The `cmakelang` package also provides a `cmake-lint` command which we could experiment with in the future. Closes apache#10571 from kszucs/update-cmake-format Authored-by: Krisztián Szűcs <szucs.krisztian@gmail.com> Signed-off-by: Sutou Kouhei <kou@clear-code.com>
run-cmake-format.pyscript to archeryarchery lint --cmake-formatformat checks without reformatting the files in-placearchery lint --cmake-format --fixfor actually reformat the filesI assume we may need tune the options a little bit, so feel free to experiment with the values defined in
cmake-format.pythen re-runarchery-lint --cmake-format --fix.The
cmakelangpackage also provides acmake-lintcommand which we could experiment with in the future.